<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/CustomCommand.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/entity/NaturalCustomer.php';
	
	error_reporting (E_ALL ^ E_NOTICE);
	
	$debug = $_SESSION['debug'];
	
	/*
	* Class to create a natural customer
	*/
	class CommandCreateNaturalCustomer extends CustomCommand {
		/*
		* Constructor of the class
		*/
		public function __construct($pkIdNumber, $firstName, $secondName, $firstLastName, 
			$secondLastName, $emailAddress) {
			$this -> naturalCustomer = new NaturalCustomer($pkIdNumber, $firstName, $secondName, 
				$firstLastName, $secondLastName, $emailAddress);
		}
		
		/*
		* Method to execute to create a natural customer
		*/
		public function execute() {
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$incad = $daoFactory -> getMySqlNaturalCustomerAccessDao();
			$naturalCustomerCreation = $incad -> createNaturalCustomer($this -> naturalCustomer);
			
			$this -> result = $naturalCustomerCreation;
		}
	}
?>